home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7177 < prev    next >
Encoding:
Text File  |  1996-08-05  |  921 b   |  58 lines

  1. Path: ix.netcom.com!netnews
  2. From: wells2@ix.netcom.com (wells)
  3. Newsgroups: comp.lang.c++
  4. Subject: emergency! need help..... please
  5. Date: Thu, 22 Feb 1996 03:37:10 GMT
  6. Organization: Netcom
  7. Message-ID: <4ggqqj$fen@cloner4.netcom.com>
  8. NNTP-Posting-Host: irv-ca9-08.ix.netcom.com
  9. X-NETCOM-Date: Wed Feb 21  8:18:27 PM PST 1996
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12.  
  13.  
  14. why doesnt this work???
  15.  
  16. i need to turn it in tommorw...
  17.  
  18. thanks if you can help..
  19.  
  20.  
  21.  
  22. #include <stdio.h>
  23. #include <iostream.h>
  24. #include <math.h>
  25.  
  26. void main(void)
  27.  
  28. {
  29.  
  30.     float l;    // loan amount
  31.     float r;    // interest rate
  32.     int n;        // number of payments
  33.     float p;    // payment
  34.     float a,b,c,d;
  35.     
  36.     cout << "Enter the full loan amount ->";
  37.     cin >> l;
  38.     cout << "\n Enter the interest rate ->";
  39.     cin >> r;
  40.     cout << "\n Enter the number of payments ->";
  41.     cin >> n;
  42.     
  43.     r=r/1200;    
  44.     
  45.     a=(l+r);
  46.     b=pow(a,n)*r;
  47.     
  48.     c=(l+r);
  49.     d=pow(c,n)-1;
  50.     p=((b/d)*l);
  51.     
  52.     cout << p;
  53.     
  54.     }
  55.     
  56.  
  57.  
  58.